/*
 *  $Id: MultiBlock.cs 975 2009-12-16 17:13:22Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Affects {
    /// <summary>
    /// Эффект: множественный блок
    /// Параметр: макс.число целей
    /// Существо может блокировать до Х целей.
    /// </summary>
    public class MultiBlock: Affect {
        public readonly int BlockCount;

        public MultiBlock(int count) {
            BlockCount = count > 0 ? count : 1;
        }

        public override string Id {
            get { return "multiblock"; }
        }
        public override string NameText {
            get { return Name.GetText(BlockCount); }
        }

        public override int BaseWeight {
            get { return BlockCount * 30; }
        }

        public override AffectIcon Icon {
            get { return AffectIcon.MultiBlock; }
        }

        public override Affect Clone() {
            return new MultiBlock(BlockCount);
        }

        public override void SetAffect() {
            base.SetAffect();
            LocalSummary.ChangeBlocks(BlockCount);
        }
        public override void ResetAffect() {
            base.ResetAffect();
            LocalSummary.ChangeBlocks(-BlockCount);
        }
    }
}